
'===============================================================================
'  Generated From - VbNet_SQL_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  **
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'MustInherit' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can Override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  Public Class YourObject
'    Inherits _YourObject
'
'  End Class
'
'===============================================================================

' Generated by MyGeneration Version # (1.3.0.3)

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Collections.Specialized

Imports MyGeneration.dOOdads

NameSpace ClassSigeco

Public MustInherit Class _si_caja
	Inherits SqlClientEntity

		Public Sub New() 
			Me.QuerySource = "si_caja"
			Me.MappingName = "si_caja"
		End Sub

	'=================================================================
	'  Public Overrides Sub AddNew()
	'=================================================================
	'
	'=================================================================
	Public Overrides Sub AddNew()
		MyBase.AddNew()
				
	End Sub
	
	Public Overrides Sub FlushData()
		Me._whereClause = nothing
		Me._aggregateClause = nothing		
		MyBase.FlushData()
	End Sub
	
		
	'=================================================================
	'  	Public Function LoadAll() As Boolean
	'=================================================================
	'  Loads all of the records in the database, and sets the currentRow to the first row
	'=================================================================
	Public Function LoadAll() As Boolean
	
		Dim parameters As ListDictionary = Nothing
		
		
    	Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_cajaLoadAll]", parameters)
		
	End Function

	'=================================================================
	' Public Overridable Function LoadByPrimaryKey()  As Boolean
	'=================================================================
	'  Loads a single row of via the primary key
	'=================================================================
        Public Overridable Function LoadByPrimaryKey(ByVal IdMovimientoCaja As Integer) As Boolean

            Dim parameters As ListDictionary = New ListDictionary()
            parameters.Add(_si_caja.Parameters.IdMovimientoCaja, IdMovimientoCaja)


            Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_cajaLoadByPrimaryKey]", parameters)

        End Function

#Region "Parameters"
        Protected Class Parameters

            Public Shared ReadOnly Property IdMovimientoCaja() As SqlParameter
                Get
                    Return New SqlParameter("@IdMovimientoCaja", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property IdUsuario() As SqlParameter
                Get
                    Return New SqlParameter("@IdUsuario", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property FechaApertura() As SqlParameter
                Get
                    Return New SqlParameter("@FechaApertura", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property FechaCierre() As SqlParameter
                Get
                    Return New SqlParameter("@FechaCierre", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property IdResponsable() As SqlParameter
                Get
                    Return New SqlParameter("@IdResponsable", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property MontoApertura() As SqlParameter
                Get
                    Return New SqlParameter("@MontoApertura", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property MontoCierre() As SqlParameter
                Get
                    Return New SqlParameter("@MontoCierre", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property BorradoPor() As SqlParameter
                Get
                    Return New SqlParameter("@BorradoPor", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property BorradoFecha() As SqlParameter
                Get
                    Return New SqlParameter("@BorradoFecha", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property Comentarios() As SqlParameter
                Get
                    Return New SqlParameter("@Comentarios", SqlDbType.NVarChar, 1000)
                End Get
            End Property

            Public Shared ReadOnly Property Diferencia() As SqlParameter
                Get
                    Return New SqlParameter("@Diferencia", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property SaldoEfectivo() As SqlParameter
                Get
                    Return New SqlParameter("@SaldoEfectivo", SqlDbType.Decimal, 0)
                End Get
            End Property

        End Class
#End Region

#Region "ColumnNames"
        Public Class ColumnNames

            Public Const IdMovimientoCaja As String = "idMovimientoCaja"
            Public Const IdUsuario As String = "idUsuario"
            Public Const FechaApertura As String = "fechaApertura"
            Public Const FechaCierre As String = "fechaCierre"
            Public Const IdResponsable As String = "idResponsable"
            Public Const MontoApertura As String = "montoApertura"
            Public Const MontoCierre As String = "montoCierre"
            Public Const BorradoPor As String = "borradoPor"
            Public Const BorradoFecha As String = "borradoFecha"
            Public Const Comentarios As String = "comentarios"
            Public Const Diferencia As String = "diferencia"
            Public Const SaldoEfectivo As String = "saldoEfectivo"

            Public Shared Function ToPropertyName(ByVal columnName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(IdMovimientoCaja) = _si_caja.PropertyNames.IdMovimientoCaja
                    ht(IdUsuario) = _si_caja.PropertyNames.IdUsuario
                    ht(FechaApertura) = _si_caja.PropertyNames.FechaApertura
                    ht(FechaCierre) = _si_caja.PropertyNames.FechaCierre
                    ht(IdResponsable) = _si_caja.PropertyNames.IdResponsable
                    ht(MontoApertura) = _si_caja.PropertyNames.MontoApertura
                    ht(MontoCierre) = _si_caja.PropertyNames.MontoCierre
                    ht(BorradoPor) = _si_caja.PropertyNames.BorradoPor
                    ht(BorradoFecha) = _si_caja.PropertyNames.BorradoFecha
                    ht(Comentarios) = _si_caja.PropertyNames.Comentarios
                    ht(Diferencia) = _si_caja.PropertyNames.Diferencia
                    ht(SaldoEfectivo) = _si_caja.PropertyNames.SaldoEfectivo

                End If

                Return CType(ht(columnName), String)

            End Function

            Private Shared ht As Hashtable = Nothing
        End Class
#End Region

#Region "PropertyNames"
        Public Class PropertyNames

            Public Const IdMovimientoCaja As String = "IdMovimientoCaja"
            Public Const IdUsuario As String = "IdUsuario"
            Public Const FechaApertura As String = "FechaApertura"
            Public Const FechaCierre As String = "FechaCierre"
            Public Const IdResponsable As String = "IdResponsable"
            Public Const MontoApertura As String = "MontoApertura"
            Public Const MontoCierre As String = "MontoCierre"
            Public Const BorradoPor As String = "BorradoPor"
            Public Const BorradoFecha As String = "BorradoFecha"
            Public Const Comentarios As String = "Comentarios"
            Public Const Diferencia As String = "Diferencia"
            Public Const SaldoEfectivo As String = "SaldoEfectivo"

            Public Shared Function ToColumnName(ByVal propertyName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(IdMovimientoCaja) = _si_caja.ColumnNames.IdMovimientoCaja
                    ht(IdUsuario) = _si_caja.ColumnNames.IdUsuario
                    ht(FechaApertura) = _si_caja.ColumnNames.FechaApertura
                    ht(FechaCierre) = _si_caja.ColumnNames.FechaCierre
                    ht(IdResponsable) = _si_caja.ColumnNames.IdResponsable
                    ht(MontoApertura) = _si_caja.ColumnNames.MontoApertura
                    ht(MontoCierre) = _si_caja.ColumnNames.MontoCierre
                    ht(BorradoPor) = _si_caja.ColumnNames.BorradoPor
                    ht(BorradoFecha) = _si_caja.ColumnNames.BorradoFecha
                    ht(Comentarios) = _si_caja.ColumnNames.Comentarios
                    ht(Diferencia) = _si_caja.ColumnNames.Diferencia
                    ht(SaldoEfectivo) = _si_caja.ColumnNames.SaldoEfectivo

                End If

                Return CType(ht(propertyName), String)

            End Function

            Private Shared ht As Hashtable = Nothing

        End Class
#End Region

#Region "StringPropertyNames"
        Public Class StringPropertyNames

            Public Const IdMovimientoCaja As String = "s_IdMovimientoCaja"
            Public Const IdUsuario As String = "s_IdUsuario"
            Public Const FechaApertura As String = "s_FechaApertura"
            Public Const FechaCierre As String = "s_FechaCierre"
            Public Const IdResponsable As String = "s_IdResponsable"
            Public Const MontoApertura As String = "s_MontoApertura"
            Public Const MontoCierre As String = "s_MontoCierre"
            Public Const BorradoPor As String = "s_BorradoPor"
            Public Const BorradoFecha As String = "s_BorradoFecha"
            Public Const Comentarios As String = "s_Comentarios"
            Public Const Diferencia As String = "s_Diferencia"
            Public Const SaldoEfectivo As String = "s_SaldoEfectivo"

        End Class
#End Region

#Region "Properties"
        Public Overridable Property IdMovimientoCaja() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdMovimientoCaja)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdMovimientoCaja, Value)
            End Set
        End Property

        Public Overridable Property IdUsuario() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdUsuario)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdUsuario, Value)
            End Set
        End Property

        Public Overridable Property FechaApertura() As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.FechaApertura)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.FechaApertura, Value)
            End Set
        End Property

        Public Overridable Property FechaCierre() As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.FechaCierre)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.FechaCierre, Value)
            End Set
        End Property

        Public Overridable Property IdResponsable() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdResponsable)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdResponsable, Value)
            End Set
        End Property

        Public Overridable Property MontoApertura() As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.MontoApertura)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.MontoApertura, Value)
            End Set
        End Property

        Public Overridable Property MontoCierre() As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.MontoCierre)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.MontoCierre, Value)
            End Set
        End Property

        Public Overridable Property BorradoPor() As Integer
            Get
                Return MyBase.Getint(ColumnNames.BorradoPor)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.BorradoPor, Value)
            End Set
        End Property

        Public Overridable Property BorradoFecha() As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.BorradoFecha)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.BorradoFecha, Value)
            End Set
        End Property

        Public Overridable Property Comentarios() As String
            Get
                Return MyBase.Getstring(ColumnNames.Comentarios)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Comentarios, Value)
            End Set
        End Property

        Public Overridable Property Diferencia() As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.Diferencia)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.Diferencia, Value)
            End Set
        End Property

        Public Overridable Property SaldoEfectivo() As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.SaldoEfectivo)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.SaldoEfectivo, Value)
            End Set
        End Property


#End Region
	
	#Region "String Properties" 

		Public Overridable Property s_IdMovimientoCaja As String
			Get
				If Me.IsColumnNull(ColumnNames.IdMovimientoCaja) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdMovimientoCaja)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdMovimientoCaja)
				Else
					Me.IdMovimientoCaja = MyBase.SetintAsString(ColumnNames.IdMovimientoCaja, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_IdUsuario As String
			Get
				If Me.IsColumnNull(ColumnNames.IdUsuario) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdUsuario)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdUsuario)
				Else
					Me.IdUsuario = MyBase.SetintAsString(ColumnNames.IdUsuario, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FechaApertura As String
			Get
				If Me.IsColumnNull(ColumnNames.FechaApertura) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.FechaApertura)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FechaApertura)
				Else
					Me.FechaApertura = MyBase.SetDateTimeAsString(ColumnNames.FechaApertura, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FechaCierre As String
			Get
				If Me.IsColumnNull(ColumnNames.FechaCierre) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.FechaCierre)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FechaCierre)
				Else
					Me.FechaCierre = MyBase.SetDateTimeAsString(ColumnNames.FechaCierre, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_IdResponsable As String
			Get
				If Me.IsColumnNull(ColumnNames.IdResponsable) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdResponsable)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdResponsable)
				Else
					Me.IdResponsable = MyBase.SetintAsString(ColumnNames.IdResponsable, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_MontoApertura As String
			Get
				If Me.IsColumnNull(ColumnNames.MontoApertura) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.MontoApertura)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.MontoApertura)
				Else
					Me.MontoApertura = MyBase.SetdecimalAsString(ColumnNames.MontoApertura, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_MontoCierre As String
			Get
				If Me.IsColumnNull(ColumnNames.MontoCierre) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.MontoCierre)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.MontoCierre)
				Else
					Me.MontoCierre = MyBase.SetdecimalAsString(ColumnNames.MontoCierre, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_BorradoPor As String
			Get
				If Me.IsColumnNull(ColumnNames.BorradoPor) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.BorradoPor)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.BorradoPor)
				Else
					Me.BorradoPor = MyBase.SetintAsString(ColumnNames.BorradoPor, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_BorradoFecha As String
			Get
				If Me.IsColumnNull(ColumnNames.BorradoFecha) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.BorradoFecha)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.BorradoFecha)
				Else
					Me.BorradoFecha = MyBase.SetDateTimeAsString(ColumnNames.BorradoFecha, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Comentarios As String
			Get
				If Me.IsColumnNull(ColumnNames.Comentarios) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Comentarios)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Comentarios)
				Else
					Me.Comentarios = MyBase.SetstringAsString(ColumnNames.Comentarios, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Diferencia As String
			Get
				If Me.IsColumnNull(ColumnNames.Diferencia) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.Diferencia)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Diferencia)
				Else
					Me.Diferencia = MyBase.SetdecimalAsString(ColumnNames.Diferencia, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_SaldoEfectivo As String
			Get
				If Me.IsColumnNull(ColumnNames.SaldoEfectivo) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.SaldoEfectivo)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.SaldoEfectivo)
				Else
					Me.SaldoEfectivo = MyBase.SetdecimalAsString(ColumnNames.SaldoEfectivo, Value)
				End If
			End Set
		End Property


	#End Region  	

	#Region "Where Clause"
    Public Class WhereClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffWhereParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffWhereParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "TearOff's"
		Public class TearOffWhereParameter

			Public Sub New(ByVal clause As WhereClause)
				Me._clause = clause
			End Sub
		
	
			Public ReadOnly Property IdMovimientoCaja() As WhereParameter
				Get
					Dim where As WhereParameter = New WhereParameter(ColumnNames.IdMovimientoCaja, Parameters.IdMovimientoCaja)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property IdUsuario() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.IdUsuario, Parameters.IdUsuario)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FechaApertura() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FechaApertura, Parameters.FechaApertura)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FechaCierre() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FechaCierre, Parameters.FechaCierre)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property IdResponsable() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.IdResponsable, Parameters.IdResponsable)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property MontoApertura() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.MontoApertura, Parameters.MontoApertura)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property MontoCierre() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.MontoCierre, Parameters.MontoCierre)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property BorradoPor() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.BorradoPor, Parameters.BorradoPor)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property BorradoFecha() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.BorradoFecha, Parameters.BorradoFecha)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Comentarios() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Comentarios, Parameters.Comentarios)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Diferencia() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Diferencia, Parameters.Diferencia)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property SaldoEfectivo() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.SaldoEfectivo, Parameters.SaldoEfectivo)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property


			Private _clause as WhereClause
		End Class
		#End Region	

		Public ReadOnly Property IdMovimientoCaja() As WhereParameter 
			Get
				If _IdMovimientoCaja_W Is Nothing Then
					_IdMovimientoCaja_W = TearOff.IdMovimientoCaja
				End If
				Return _IdMovimientoCaja_W
			End Get
		End Property

		Public ReadOnly Property IdUsuario() As WhereParameter 
			Get
				If _IdUsuario_W Is Nothing Then
					_IdUsuario_W = TearOff.IdUsuario
				End If
				Return _IdUsuario_W
			End Get
		End Property

		Public ReadOnly Property FechaApertura() As WhereParameter 
			Get
				If _FechaApertura_W Is Nothing Then
					_FechaApertura_W = TearOff.FechaApertura
				End If
				Return _FechaApertura_W
			End Get
		End Property

		Public ReadOnly Property FechaCierre() As WhereParameter 
			Get
				If _FechaCierre_W Is Nothing Then
					_FechaCierre_W = TearOff.FechaCierre
				End If
				Return _FechaCierre_W
			End Get
		End Property

		Public ReadOnly Property IdResponsable() As WhereParameter 
			Get
				If _IdResponsable_W Is Nothing Then
					_IdResponsable_W = TearOff.IdResponsable
				End If
				Return _IdResponsable_W
			End Get
		End Property

		Public ReadOnly Property MontoApertura() As WhereParameter 
			Get
				If _MontoApertura_W Is Nothing Then
					_MontoApertura_W = TearOff.MontoApertura
				End If
				Return _MontoApertura_W
			End Get
		End Property

		Public ReadOnly Property MontoCierre() As WhereParameter 
			Get
				If _MontoCierre_W Is Nothing Then
					_MontoCierre_W = TearOff.MontoCierre
				End If
				Return _MontoCierre_W
			End Get
		End Property

		Public ReadOnly Property BorradoPor() As WhereParameter 
			Get
				If _BorradoPor_W Is Nothing Then
					_BorradoPor_W = TearOff.BorradoPor
				End If
				Return _BorradoPor_W
			End Get
		End Property

		Public ReadOnly Property BorradoFecha() As WhereParameter 
			Get
				If _BorradoFecha_W Is Nothing Then
					_BorradoFecha_W = TearOff.BorradoFecha
				End If
				Return _BorradoFecha_W
			End Get
		End Property

		Public ReadOnly Property Comentarios() As WhereParameter 
			Get
				If _Comentarios_W Is Nothing Then
					_Comentarios_W = TearOff.Comentarios
				End If
				Return _Comentarios_W
			End Get
		End Property

		Public ReadOnly Property Diferencia() As WhereParameter 
			Get
				If _Diferencia_W Is Nothing Then
					_Diferencia_W = TearOff.Diferencia
				End If
				Return _Diferencia_W
			End Get
		End Property

		Public ReadOnly Property SaldoEfectivo() As WhereParameter 
			Get
				If _SaldoEfectivo_W Is Nothing Then
					_SaldoEfectivo_W = TearOff.SaldoEfectivo
				End If
				Return _SaldoEfectivo_W
			End Get
		End Property

		Private _IdMovimientoCaja_W As WhereParameter = Nothing
		Private _IdUsuario_W As WhereParameter = Nothing
		Private _FechaApertura_W As WhereParameter = Nothing
		Private _FechaCierre_W As WhereParameter = Nothing
		Private _IdResponsable_W As WhereParameter = Nothing
		Private _MontoApertura_W As WhereParameter = Nothing
		Private _MontoCierre_W As WhereParameter = Nothing
		Private _BorradoPor_W As WhereParameter = Nothing
		Private _BorradoFecha_W As WhereParameter = Nothing
		Private _Comentarios_W As WhereParameter = Nothing
		Private _Diferencia_W As WhereParameter = Nothing
		Private _SaldoEfectivo_W As WhereParameter = Nothing

			Public Sub WhereClauseReset()

			_IdMovimientoCaja_W = Nothing
			_IdUsuario_W = Nothing
			_FechaApertura_W = Nothing
			_FechaCierre_W = Nothing
			_IdResponsable_W = Nothing
			_MontoApertura_W = Nothing
			_MontoCierre_W = Nothing
			_BorradoPor_W = Nothing
			_BorradoFecha_W = Nothing
			_Comentarios_W = Nothing
			_Diferencia_W = Nothing
			_SaldoEfectivo_W = Nothing
				Me._entity.Query.FlushWhereParameters()

			End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffWhereParameter
    End Class	

	Public ReadOnly Property Where() As WhereClause
		Get
			If _whereClause Is Nothing Then
				_whereClause = New WhereClause(Me)
			End If
	
			Return _whereClause
		End Get
	End Property
	
	Private _whereClause As WhereClause = Nothing	
#End Region	

#Region "Aggregate Clause"
    Public Class AggregateClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffAggregateParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffAggregateParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "AggregateParameter TearOff's"
		Public class TearOffAggregateParameter

			Public Sub New(ByVal clause As AggregateClause)
				Me._clause = clause
			End Sub
		
	
		Public ReadOnly Property IdMovimientoCaja() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdMovimientoCaja, Parameters.IdMovimientoCaja)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property IdUsuario() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdUsuario, Parameters.IdUsuario)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FechaApertura() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FechaApertura, Parameters.FechaApertura)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FechaCierre() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FechaCierre, Parameters.FechaCierre)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property IdResponsable() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdResponsable, Parameters.IdResponsable)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property MontoApertura() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.MontoApertura, Parameters.MontoApertura)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property MontoCierre() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.MontoCierre, Parameters.MontoCierre)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property BorradoPor() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.BorradoPor, Parameters.BorradoPor)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property BorradoFecha() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.BorradoFecha, Parameters.BorradoFecha)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Comentarios() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Comentarios, Parameters.Comentarios)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Diferencia() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Diferencia, Parameters.Diferencia)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property SaldoEfectivo() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.SaldoEfectivo, Parameters.SaldoEfectivo)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property


			Private _clause as AggregateClause
		End Class
		#End Region	

		Public ReadOnly Property IdMovimientoCaja() As AggregateParameter 
			Get
				If _IdMovimientoCaja_W Is Nothing Then
					_IdMovimientoCaja_W = TearOff.IdMovimientoCaja
				End If
				Return _IdMovimientoCaja_W
			End Get
		End Property

		Public ReadOnly Property IdUsuario() As AggregateParameter 
			Get
				If _IdUsuario_W Is Nothing Then
					_IdUsuario_W = TearOff.IdUsuario
				End If
				Return _IdUsuario_W
			End Get
		End Property

		Public ReadOnly Property FechaApertura() As AggregateParameter 
			Get
				If _FechaApertura_W Is Nothing Then
					_FechaApertura_W = TearOff.FechaApertura
				End If
				Return _FechaApertura_W
			End Get
		End Property

		Public ReadOnly Property FechaCierre() As AggregateParameter 
			Get
				If _FechaCierre_W Is Nothing Then
					_FechaCierre_W = TearOff.FechaCierre
				End If
				Return _FechaCierre_W
			End Get
		End Property

		Public ReadOnly Property IdResponsable() As AggregateParameter 
			Get
				If _IdResponsable_W Is Nothing Then
					_IdResponsable_W = TearOff.IdResponsable
				End If
				Return _IdResponsable_W
			End Get
		End Property

		Public ReadOnly Property MontoApertura() As AggregateParameter 
			Get
				If _MontoApertura_W Is Nothing Then
					_MontoApertura_W = TearOff.MontoApertura
				End If
				Return _MontoApertura_W
			End Get
		End Property

		Public ReadOnly Property MontoCierre() As AggregateParameter 
			Get
				If _MontoCierre_W Is Nothing Then
					_MontoCierre_W = TearOff.MontoCierre
				End If
				Return _MontoCierre_W
			End Get
		End Property

		Public ReadOnly Property BorradoPor() As AggregateParameter 
			Get
				If _BorradoPor_W Is Nothing Then
					_BorradoPor_W = TearOff.BorradoPor
				End If
				Return _BorradoPor_W
			End Get
		End Property

		Public ReadOnly Property BorradoFecha() As AggregateParameter 
			Get
				If _BorradoFecha_W Is Nothing Then
					_BorradoFecha_W = TearOff.BorradoFecha
				End If
				Return _BorradoFecha_W
			End Get
		End Property

		Public ReadOnly Property Comentarios() As AggregateParameter 
			Get
				If _Comentarios_W Is Nothing Then
					_Comentarios_W = TearOff.Comentarios
				End If
				Return _Comentarios_W
			End Get
		End Property

		Public ReadOnly Property Diferencia() As AggregateParameter 
			Get
				If _Diferencia_W Is Nothing Then
					_Diferencia_W = TearOff.Diferencia
				End If
				Return _Diferencia_W
			End Get
		End Property

		Public ReadOnly Property SaldoEfectivo() As AggregateParameter 
			Get
				If _SaldoEfectivo_W Is Nothing Then
					_SaldoEfectivo_W = TearOff.SaldoEfectivo
				End If
				Return _SaldoEfectivo_W
			End Get
		End Property

		Private _IdMovimientoCaja_W As AggregateParameter = Nothing
		Private _IdUsuario_W As AggregateParameter = Nothing
		Private _FechaApertura_W As AggregateParameter = Nothing
		Private _FechaCierre_W As AggregateParameter = Nothing
		Private _IdResponsable_W As AggregateParameter = Nothing
		Private _MontoApertura_W As AggregateParameter = Nothing
		Private _MontoCierre_W As AggregateParameter = Nothing
		Private _BorradoPor_W As AggregateParameter = Nothing
		Private _BorradoFecha_W As AggregateParameter = Nothing
		Private _Comentarios_W As AggregateParameter = Nothing
		Private _Diferencia_W As AggregateParameter = Nothing
		Private _SaldoEfectivo_W As AggregateParameter = Nothing

		Public Sub AggregateClauseReset()

		_IdMovimientoCaja_W = Nothing
		_IdUsuario_W = Nothing
		_FechaApertura_W = Nothing
		_FechaCierre_W = Nothing
		_IdResponsable_W = Nothing
		_MontoApertura_W = Nothing
		_MontoCierre_W = Nothing
		_BorradoPor_W = Nothing
		_BorradoFecha_W = Nothing
		_Comentarios_W = Nothing
		_Diferencia_W = Nothing
		_SaldoEfectivo_W = Nothing
			Me._entity.Query.FlushAggregateParameters()

		End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffAggregateParameter
    End Class	

	Public ReadOnly Property Aggregate() As AggregateClause
		Get
			If _aggregateClause Is Nothing Then
				_aggregateClause = New AggregateClause(Me)
			End If
	
			Return _aggregateClause
		End Get
	End Property
	
	Private _aggregateClause As AggregateClause = Nothing	
#End Region	

	Protected Overrides Function GetInsertCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_cajaInsert]" 
	    
		CreateParameters(cmd)
		
		Dim p As SqlParameter
		p = cmd.Parameters(Parameters.IdMovimientoCaja.ParameterName)
		p.Direction = ParameterDirection.Output
    
		Return cmd 

  	End Function
	
	Protected Overrides Function GetUpdateCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_cajaUpdate]" 
		
		CreateParameters(cmd) 
		    
		Return cmd
	
	End Function	
	
	Protected Overrides Function GetDeleteCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_cajaDelete]" 
		
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdMovimientoCaja)
		p.SourceColumn = ColumnNames.IdMovimientoCaja
		p.SourceVersion = DataRowVersion.Current

  
		Return cmd
	
	End Function	
	
	Private Sub CreateParameters(ByVal cmd As SqlCommand)
	
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdMovimientoCaja)
		p.SourceColumn = ColumnNames.IdMovimientoCaja
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.IdUsuario)
		p.SourceColumn = ColumnNames.IdUsuario
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FechaApertura)
		p.SourceColumn = ColumnNames.FechaApertura
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FechaCierre)
		p.SourceColumn = ColumnNames.FechaCierre
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.IdResponsable)
		p.SourceColumn = ColumnNames.IdResponsable
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.MontoApertura)
		p.SourceColumn = ColumnNames.MontoApertura
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.MontoCierre)
		p.SourceColumn = ColumnNames.MontoCierre
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.BorradoPor)
		p.SourceColumn = ColumnNames.BorradoPor
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.BorradoFecha)
		p.SourceColumn = ColumnNames.BorradoFecha
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Comentarios)
		p.SourceColumn = ColumnNames.Comentarios
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Diferencia)
		p.SourceColumn = ColumnNames.Diferencia
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.SaldoEfectivo)
		p.SourceColumn = ColumnNames.SaldoEfectivo
		p.SourceVersion = DataRowVersion.Current


	End Sub	

End Class

End NameSpace

